package com.valiscalc.controller;


import com.baomidou.mybatisplus.extension.api.R;
import com.valiscalc.entity.User;
import com.valiscalc.service.UserService;
import com.valiscalc.util.response.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;

import java.util.List;

/**
 * <p>
 *  用户控制器
 * </p>
 *
 * @author vallis
 * @since 2020-11-17
 */
@Controller
@RequestMapping("/user")
public class UserController {
    
    @Autowired
    private UserService userService;
    
    /**
     * 新建用户
     * @param user
     * @return
     */
    public Result addUser(User user){
        
        userService.save(user);
        return new Result(true,null, null);
    }
    
    /**
     * 更改用户
     * @param user
     * @return
     *
     */
    public Result updateUser(User user){
        userService.save(user);
        return new Result(true,null, null);
        
    }
    
    /**
     * 获取用户列表
     * @return
     */
    public Result getUserList(){
        
        return  new Result(true,null, null);
        
    }
    
    
    public Result login(String username,String password){
    //发送jwt token
        return  new Result(true,null, null);
    }
    
    
    
}
